/**
 * 
 */
package com.app.service.impl.ajaxservice;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.app.service.BaseService;
import com.app.service.IAjaxService;
import com.app.service.vo.UserVo;

/**
 * @author Administrator
 *
 */
public class RuleUserCheckedImpl extends BaseService implements IAjaxService {

	/**
	 * 
	 */
	public RuleUserCheckedImpl() {
		// TODO Auto-generated constructor stub
	}

	/* (non-Javadoc)
	 * @see com.app.service.IAjaxService#execute(javax.servlet.http.HttpServletRequest)
	 */
	@SuppressWarnings("unchecked")
	@Override
	public Map<?, ?> execute(HttpServletRequest request) {
		// TODO Auto-generated method stub
		String ruleid = request.getParameter("ruleid");
		Map<String,List<String>> params = new HashMap<String,List<String>>();
		List<UserVo> uservolist = (List<UserVo>) this.getCacheService().getObject("corn-user-list");
		List<String> userlist = new ArrayList<String>();
		for(UserVo vo:uservolist)
		{
			if(vo.getRoleId().equals(ruleid))
			{
				userlist.add(vo.getId());
			}
		}
		params.put("checkeds", userlist);
		return params;
	}

}
